// ReactDom.findDOMNode()
import React from "react";
import ReactDOM from "react-dom";

class FindDomNodeDemo extends React.Component {

  handlerFindDom = () => {
    console.log(ReactDOM.findDOMNode(this));
    console.log(ReactDOM.findDOMNode(document.getElementById("box1")));
  }
  render() {
    return (
      <div style={{ color: 'red' }}>
        <h1>HELLO WORLD</h1>
        <button type="button" onClick={this.handlerFindDom}> 获取组件对象</button>
      </div>
    )
  }
}

export default FindDomNodeDemo